/*$(document).ready(function () {
    $("#login_sub").click(function () {
        $("#submitForm").submit();
    });
    $('#pwd').keypress(enterLogin).keydown(enterLogin);
});*/

function enterLogin(e) { // 传入 event
    var e = e || window.event;
    if (e.keyCode == 13) {
        $("#submitForm").submit();
    }
}
$(function () {

    $("#login_sub").click(function () {


            $("#submitForm").ajaxSubmit(function (data) {
                var dialog = $.dialog({
                    title: "提示",
                    content: data.msg
                })
                if (data.success) {
                    dialog.button({
                        name: "确定",
                        callback: function () {
                            window.location.href = "/main.do"
                        }

                    });
                } else {
                    dialog.button({
                        name: "确定"
                    });
                }
            });
            return false;
        });
})